package com.getword.web.controller.teacher;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/teacher/outline")
public class OutlineController {
    @GetMapping("/index.html")
    public String index(HttpServletRequest request){
        request.setAttribute("navi", "outline");
        return "teacher/outline/index.html";
    }

//    @CrossOrigin(maxAge = 3600)
    @GetMapping("/search.html")
    public String outlineEditTemp(HttpServletResponse response, HttpServletRequest request){
        request.setAttribute("navi", "outline");
//        response.addHeader("x-frame-options","SAMEORIGIN");
        return "teacher/outline/search.html";
    }

    @GetMapping("/manage.html")
    public String manage(HttpServletResponse response, HttpServletRequest request){
        request.setAttribute("navi", "outline");
        return "teacher/outline/manage.html";
    }
    @GetMapping("/template.html")
    public String template(HttpServletResponse response, HttpServletRequest request){
        request.setAttribute("navi", "outline");
        return "teacher/outline/template.html";
    }
    @GetMapping("/detail.html")
    public String detail(HttpServletResponse response, HttpServletRequest request, String outlineId){
        request.setAttribute("navi", "outline");
        request.setAttribute("outlineId", outlineId);
        return "teacher/outline/detail.html";
    }
}
